package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.cnswhy.cloud.server.common.entity.enumeration.ChannelType;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-07-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_cps_customer_channel_info")
@ApiModel(value = "CpsCustomerChannelInfo", description = "")
@AllArgsConstructor
public class CpsCustomerChannelInfo extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "")
    @NotNull(message = "不能为空")
    @TableField("customer_id")
    @Excel(name = "")
    private Long customerId;

    @ApiModelProperty(value = "")
    @Length(max = 50, message = "长度不能超过50")
    @TableField(value = "bank_num", condition = LIKE)
    @Excel(name = "")
    private String bankNum;

    @ApiModelProperty(value = "")
    @Length(max = 20, message = "长度不能超过20")
    @TableField(value = "account_name", condition = LIKE)
    @Excel(name = "")
    private String accountName;

    @ApiModelProperty(value = "")
    @Length(max = 11, message = "长度不能超过11")
    @TableField(value = "mobile", condition = LIKE)
    @Excel(name = "")
    private String mobile;

    @ApiModelProperty(value = "")
    @Length(max = 18, message = "长度不能超过18")
    @TableField(value = "id_card", condition = LIKE)
    @Excel(name = "")
    private String idCard;

    /**
     * 银行简称
     */
    @ApiModelProperty(value = "银行简称")
    @Length(max = 20, message = "银行简称长度不能超过20")
    @TableField(value = "bank_abbr", condition = LIKE)
    @Excel(name = "银行简称")
    private String bankAbbr;

    /**
     * 渠道ID
     */
    @ApiModelProperty(value = "渠道ID")
    @Length(max = 20, message = "渠道ID长度不能超过20")
    @TableField(value = "channel_id", condition = LIKE)
    @Excel(name = "渠道ID")
    private String channelId;

    /**
     * 费率，万分之1
     */
    @ApiModelProperty(value = "费率，万分之1")
    @TableField("fee_rate")
    @Excel(name = "费率，万分之1")
    private Long feeRate;

    /**
     * 附加手续费
     */
    @ApiModelProperty(value = "附加手续费")
    @TableField("extern_fee")
    @Excel(name = "附加手续费")
    private Long externFee;

    /**
     * 进件返回商户号
     */
    @ApiModelProperty(value = "进件返回商户号")
    @Length(max = 255, message = "进件返回商户号长度不能超过255")
    @TableField(value = "sub_merch_id", condition = LIKE)
    @Excel(name = "进件返回商户号")
    private String subMerchId;

    /**
     * 钱包类型 #ChannelType{LITTLE:小额;LARGE:大额;}
     */
    @ApiModelProperty(value = "钱包类型 #ChannelType{LITTLE:小额;LARGE:大额;}")
    @TableField("channel_type")
    @Excel(name = "钱包类型 #ChannelType{LITTLE:小额;LARGE:大额;}", replace = {"小额_LITTLE", "大额_LARGE",  "_null"})
    private ChannelType channelType;


    @Builder
    public CpsCustomerChannelInfo(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long updateUser, Long createUser, 
                    Long customerId, String bankNum, String accountName, String mobile, String idCard, 
                    String bankAbbr, String channelId, Long feeRate, Long externFee, String subMerchId, ChannelType channelType) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.createUser = createUser;
        this.customerId = customerId;
        this.bankNum = bankNum;
        this.accountName = accountName;
        this.mobile = mobile;
        this.idCard = idCard;
        this.bankAbbr = bankAbbr;
        this.channelId = channelId;
        this.feeRate = feeRate;
        this.externFee = externFee;
        this.subMerchId = subMerchId;
        this.channelType = channelType;
    }

}
